# -------------------------------------------------------------------
# Unix specific defaults
#
# See 'Tools/qmake/README' for an overview of the build system
# -------------------------------------------------------------------

# Use SSE2 floating point math on 32 bit instead of the default
# 387 to make layout test results same on 32 and on 64 bit builds.
# See https://bugs.webkit.org/show_bug.cgi?id=52810#c39 for details.
linux-g++*:isEqual(QT_ARCH,i386) {
    QMAKE_CFLAGS += -march=pentium4 -msse2 -mfpmath=sse
    QMAKE_CXXFLAGS += -march=pentium4 -msse2 -mfpmath=sse

    # Use the stabs format for 32 bit debug builds to make the object files a bit smaller.
    QMAKE_CXXFLAGS_DEBUG -= -g
    QMAKE_CXXFLAGS_DEBUG += -gstabs
}

linux-*g++* {
    !production_build {
        # Treat warnings as errors on x86/Linux/GCC
        isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror
    }
    greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 5) {
        !contains(QMAKE_CXXFLAGS, -std=(c|gnu)\\+\\+(0x|11)) {
            # We need to deactivate those warnings because some names conflicts with upcoming c++0x types (e.g.nullptr).
            QMAKE_CXXFLAGS_WARN_ON += -Wno-c++0x-compat
            QMAKE_CXXFLAGS += -Wno-c++0x-compat
        }
    }
}

# Don't warn about OVERRIDE and FINAL, since they are feature-checked anyways
*clang:!contains(QMAKE_CXXFLAGS, -std=c++11) {
    QMAKE_CXXFLAGS += -Wno-c++11-extensions -Wno-c++0x-extensions
    QMAKE_OBJECTIVE_CFLAGS += -Wno-c++11-extensions -Wno-c++0x-extensions
}

contains(TEMPLATE, app): CONFIG += rpath

isEqual(QT_ARCH,i386):CONFIG(debug, debug|release) {
  # Make ld not cache the symbol tables of input files in memory to avoid memory exhaustion during the linking phase.
  config_gnuld: QMAKE_LFLAGS += -Wl,--no-keep-memory
}

load(default_post)
